<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<%@include file="/commons/etCommonHead.jsp"%>

</head>
<body>
  <div id="header">
      <div class="gohome radius20"><a href="<%=basePath%>ph/sys/index.do"><img src="<%=basePath%>et/images/icons/home.png" alt="" title="" /></a></div>
      <div class="gomenu radius20"><a href="<%=basePath%>ph/sys/ordered.do" onclick=""><img src="<%=basePath%>et/images/icons/about.png" alt="" title="" /></a></div>
  </div>
  <div class="swiper-container swiper-parent">
    <div class="swiper-wrapper">
<!--Page 9 content-->
      <div class="swiper-slide sliderbg">
      <div class="swiper-container swiper-nested9">
               <div class="swiper-wrapper">
                    <div class="swiper-slide">
                              <div class="slide-inner">
                                        <div class="pages_container">
                                        
                                        <h3 class="page_title">修改用户信息</h3>
                                            <div class="form">
                                            <form id="formSubmit" action="<%=basePath%>ph/sys/useredit.do" method="post">
                                            <input type="hidden" name="id" id="id" value="${user.id }"/>
                                            <label style="float: left;">用户名:</label><span style="float: right;">不能修改</span>
                                            <input type="text" readonly="readonly" value="${user.userName }" class="form_input radius4 txt " />
                                            <label style="float: left;">中文名:</label><span id="sp_chineseName"></span>
                                            <input type="text" name="chineseName" id="chineseName" value="${user.chineseName }" class="form_input radius4 txt" />
											<label style="float: left;">英文名:</label><span id="sp_englishName"></span>
                                            <input type="text" name="englishName" id="englishName" value="${user.englishName }" class="form_input radius4 txt " />
											<label style="float: left;">学校名:</label><span id="sp_schoolName"></span>
                                            <input type="text" name="schoolName" id="schoolName" value="${user.schoolName }" class="form_input radius4 txt " />
                                            <label style="float: left;">专业名:</label><span id="sp_majorName"></span>
                                            <input type="text" name="majorName" id="majorName" value="${user.majorName }" class="form_input radius4 txt " />
											<label style="float: left;">年龄:</label><span id="sp_age"></span>
                                            <input type="text" name="age" id="age" value="${user.age }" class="form_input radius4 txt " />
											<label style="float: left;">手机号:</label><span id="sp_mobile"></span>
                                            <input type="text" name="mobile" id="mobile" value="${user.mobile }" class="form_input radius4 txt " />
											<label style="float: left;">地址:</label><span id="sp_address"></span>
                                            <input type="text" name="address" id="address" value="${user.address }" class="form_input radius4 txt " />
											
                                            
											<a href="javascript:save();" class="button_12 blue blue_borderbottom radius4">保存</a>
                                        <a href="javascript:history.back();" class="button_12 red red_borderbottom radius4">取消</a>
                                          
                                            </form>
                                            </div>

                                            
                                       
                                        
                                        

                                        <div class="clearfix"></div>
                                        <div class="scrolltop radius20"><a href="#" class="scrolltop9"><img src="<%=basePath%>et/images/icons/top.png" alt="Go on top" title="Go on top" /></a></div>    
                                        </div>
                                        <!--End of page container-->
                              </div>
                    </div>
              </div>
              <div class="swiper-scrollbar9"></div>
     </div>
     </div>
       
     <!--End of pages--> 

    </div>

  </div>
</body>
<%@include file="/commons/etCommonJs.jsp"%>
<script type="text/javascript">
$(document).ready(function(){
	  $("#age").blur(function(){
	  	 myValidate('age',false,'num');
	  });
	  $("#mobile").blur(function(){
	  	 myValidate('mobile',false,'mobile');
	  });
	  $("#address").blur(function(){
	  	 myValidate('address',false,'text',4,50);
	  });
	  $("#schoolName").blur(function(){
	  	 myValidate('schoolName',false,'text',4,30);
	  });
	  $("#majorName").blur(function(){
	  	 myValidate('majorName',false,'text',4,30);
	  });
	  $("#chineseName").blur(function(){
	  	 myValidate('chineseName',false,'text',4,30);
	  });
	  $("#englishName").blur(function(){
	  	 myValidate('englishName',false,'text',2,30);
	  });
});
function save(){
	  	 var flag1=myValidate('age',false,'num');
	  	 var flag2=myValidate('mobile',false,'mobile');
	  	 var flag3=myValidate('address',false,'text',4,50);
	  	 var flag4= myValidate('schoolName',false,'text',4,30);
	  	 var flag5= myValidate('majorName',false,'text',4,30);
	  	 var flag6=myValidate('chineseName',false,'text',4,30);
	  	 var flag7=myValidate('englishName',false,'text',2,30);
	  	 
		if(flag1&&flag2&&flag3&&flag4&&flag5&&flag6&&flag7){
			ajaxForm(false, '', '<%=basePath%>ph/sys/useredit.do', 'formSubmit', save2);
		}
}
function save2(data,divId){
	if(data["flag"]==0){
		alert("用户信息修改成功！");
		window.location.href='<%=basePath%>ph/sys/userinfo.do?id='+data["id"];
	}else{
		alert(data["message"]);
	}
}

</script>
</html>